<script lang="tsx">
/**
 * 获取库存结存列表
 */
export default {
    name: "warehouse-balance"
}
</script>

<script lang="tsx" setup>
import { ref } from "vue"
import { definePageModel, PageModel } from "@/frame/view/layout/page-model/constructor.ts"
import OrderDetail from "./components/order-detail/index.vue"

/**
 * 页面配置
 */
const pageModelRef = ref()
const config = definePageModel<any>({
    url: "/api/WarehouseBalance",
    searchForm: {
        els: [
            {
                eType: 'el-input',
                prop: "goods",
                props: {
                    placeholder: "物料名称",
                    clearable: true
                }
            }
        ]
    },
    table: {
        page: {
            enable: true,
            pageSize: 20
        },
        props: {
            stripe: false,
            border: false
        },
        operation: {
            width: 80,
            els: [
                {
                    eType: "el-button",
                    label: "详情",
                    event: "detail",
                    props: {
                        type: "primary",
                        link: true
                    },
                    hide: false
                }
            ]
        },
        els: [
            {
                label: "物料编码",
                prop: "goodsCode",
                minWidth: 120
            },
            {
                label: "物料名称",
                prop: "goodsName",
                minWidth: 120
            },
            {
                label: "物料规格",
                prop: "goodsSpec",
                minWidth: 120
            },
            {
                label: "期初数量",
                prop: "number_Begin",
                minWidth: 120
            },
            {
                label: "期末数量",
                prop: "number_End",
                minWidth: 120
            },
            {
                label: "入库数量",
                prop: "number_In",
                minWidth: 120
            },
            {
                label: "出库数量",
                prop: "number_Out",
                minWidth: 120
            }

        ]
    }
})

/**
 * 查看详情
 */
const orderDetailRef = ref()
const handleDetail = (row:any) => {
    orderDetailRef.value.show({
        id:row.id
    })
}
</script>

<template>
    <PageModel ref="pageModelRef" :PageModel="config" @detail="handleDetail" />

    <OrderDetail ref="orderDetailRef" />
</template>